Query XML

Use the Query XML action A tool for building the processes, logic, and direction within workflows. Actions are the steps the workflow performs to complete a process. to query specific information from an XML (Extensible Markup Language) content. You can use this action to read an XML file.

Before you begin:

Jump to:

Configure the Query XML action

  1. Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.

  2. Specify the XML Source that contains the data you want to query.
  3. Type the XPath Query.
  4. Specify how you want to return the result.
  5. Click Save.

Query XML fields, buttons, and settings

Field or button

Description

Variable types
XML Source

The XML content that you want to query. For example: <Book><Author>hello there</Author></Book>

Note: Although XML-reserved characters such as an ampersand ("&") or less-than sign ("<") are supported, the returned output is encoded.

Text, Decimal, Integer, Boolean, DateTime, Collection
XPath Query

The XPath (XML Path Language) query used to retrieve nodes in an XML. The XPath query can resolve to a single node or a node list. If the result is a node list, the specified change will be applied to each node.

For example, if you want to retrieve the inner XML of the XML Source "<Book><Author>hello there</Author></Book>," then the XPath Query is .//Author.

Text, Decimal, Integer, Boolean, DateTime, Collection
Return result as

Select one of the following to specify how you want the result to be returned.

  • Text: Returns the concatenated values of the node and the child nodes.
  • For example, if the XML Source is <Book><Author>Hello there</Author><Author>Test</Author></Book>, then the Text output is Hello thereTest.

  • Inner XML: Returns the markup representing only the child nodes of current node.
  • For example, if the XML Source is <Book><Author>hello there</Author></Book>, then the Inner XML output is <Author>hello there</Author>.

  • Outer XML: Returns the markup representing the current node and all its child nodes.
  • For example, if the XML Source is <Book><Author>hello there</Author></Book>, then the Inner XML output is <Book><Author>hello there</Author</Book>.

    Note: 
    • If you choose Text, XML-reserved characters, such as "&" and "<", appear unchanged in the output. For example, if the input XML contains the phrase "&<", the output will contain the phrase"&<".

    • If you choose Inner XML or Outer XML, XML-reserved characters, such as "&" and "<", appear encoded in the output. For example, if the input XML contains the phrase "&", the output will contain the phrase "&amp".

    • The output is encoded to UTF-16.

(n/a)
Store first result in The variable used to store only the first result of the query results. Text
Store results in The Collection or Dictionary variable used to store the query results. All values are returned. Collection